using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.Net.Mail;
/// <summary>
/// Summary description for KTEmail
/// </summary>
public class KTEmail
{
	public KTEmail()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    /// <summary>
    /// Method to send email throung google mail account (smtp)
    /// </summary>
    /// <param name="from"></param>
    /// <param name="to"></param>
    /// <param name="subject"></param>
    /// <param name="body"></param>
public void Sendmail(string from, string to, string subject, string body)
 {
 MailMessage mailMsg = new MailMessage();
   mailMsg.From = new MailAddress(from, "Karnel Travel"); 
   mailMsg.To.Add(to);
   mailMsg.Subject = subject;
   mailMsg.IsBodyHtml = true;
   mailMsg.Body = body;
   mailMsg.Priority = MailPriority.Normal;
   SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
   NetworkCredential info = new NetworkCredential("littlecatdevil@gmail.com", "u!tellme1time");
   client.DeliveryMethod = SmtpDeliveryMethod.Network;
   client.Credentials = info;
   client.EnableSsl = true;
   client.Send(mailMsg);
   System.Threading.Thread.Sleep(3000);

 }

}
